<template>
  <div class="box">
    <div class="header">
      <input type="text" placeholder="搜索" />
      <div class="dv1">搜索</div>
    </div>
    <div class="type">
      <div class="type1">
        <ul>
          <li>装修前</li>
          <li>装修中</li>
          <li>装修后</li>
        </ul>
        <div class="dv2">
          <div class="dv3">
            <i class="iconfont icon-house"></i>
            <span>收房验房</span>
          </div>
          <div class="dv3">
            <i class="iconfont icon-budget"></i>
            <span>装修预算</span>
          </div>
          <div class="dv3">
            <i class="iconfont icon-taiji"></i>
            <span>装修风水</span>
          </div>
          <div class="dv3">
            <i class="iconfont icon-pencle"></i>
            <span>装修设计</span>
          </div>
        </div>
        <div class="dv4" @click="liucheng">了解装修流程</div>
      </div>
    </div>
    <div class="swiper-name">
                <p class="pone">工地直播</p>
          </div>
    <div class="dv6">
      <ul>
        <li v-for="(item,index) in list" :key="index" class="li-one">
          <div class="one-img">
            <img :src="item.img" alt="" />
          </div>
          <div class="one-box">
            <p class="p1">
              {{item.title}}
            </p>
            <p class="p2">
              <span><i class="iconfont icon-time"></i>{{item.edit_time}}</span>
              &emsp; <span><i class="iconfont icon-view"></i>{{item.view_num}}</span>
            </p>
          </div>
        </li>
      </ul>
      <div class="box">
        <div class="hyh">换一换 <i class="iconfont icon-change"></i></div>
      </div>
      <!-- 底部 -->
        <my-buttom></my-buttom>
    </div>
    <!-- <div class="dv5"></div> -->
  </div>
</template>

<script>
import axios from 'axios'
  import myButtom from "@/components/Bottom.vue"

export default {
  data() {
    return {
      list:[]
    };
  },
  created(){
     axios.get("/api/home/gonglue").then((res)=>{
      console.log(res.data.data);
      this.list=res.data.data.list
    })
  },  
  mounted() {},
  methods: {
     liucheng(){
      this.$router.push('/ZxType')
    },
  },
  components: {
    myButtom,
  },
};
</script>

<style lang='scss' scoped>
.box {
  width: 100%;
  height: 100%;
  .header {
    background-color: #eaeaea;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-around;
    input {
      width: 80%;
      height: 36px;
      border: 1px solid #2bb281;
      // padding-left: 5px;
      margin-top: 10px;
    }
    .dv1 {
      width: 15%;
      height: 40px;
      line-height: 40px;
      background-color: #2bb281;
      color: #fff;
      margin-top: 10px;
      text-align: center;
    }
  }
  .type {
    width: 100%;
    // height: 100%;
    .type1 {
      width: 95%;
      height: 100%;
      margin: 0 auto;
      text-align: center;
      ul {
        height: 40px;
        line-height: 40px;
        display: flex;
        justify-content: space-around;
        li {
          flex-basis: 28%;
        }
        // li:hover {
        //   border-bottom: 2px solid #2bb281;
        // }
      }
      .dv2 {
        width: 100%;
        display: flex;
        justify-content: space-around;
        .dv3 {
          flex-basis: 25%;
          display: flex;
          flex-direction: column;
          text-align: center;
          i {
            width: 80%;
            height: 72px;
            line-height: 72px;
            border: 3px solid #2bb281;
            font-size: 30px;
            color: #2bb281;
            border-radius: 50%;
            margin-left: 10px;
            margin-top: 20px;
          }
          span {
            margin: 10px 0;
          }
        }
      }
      .dv4 {
        width: 100%;
        height: 30px;
        line-height: 30px;
        border: 1px solid #2bb281;
        border-radius: 4px;
        margin: 10px 0;
        color: #2bb281;
        text-align: center;
      }
    }
  }
  .dv5 {
    background-color: #eaeaea;
    width: 100%;
    height: 10px;
  }
  .dv6 {
    width: 100%;
    height: 100%;
    .li-one {
      width: 95%;
      height: 80px;
      display: flex;
      margin: 10px auto;
      border-bottom: 1px solid #eee;
      .one-img {
        width: 30%;
        height: 69px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .one-box {
        margin: 0;
        position: relative;
        padding: 0;
        .p2 {
          margin-top: 45px;
          margin-left: 10px;
          font-size: 15px;
          color: #ccc;
        }
        .p1 {
          line-height: 30px;
          width: 240px;
          margin: 0;
          padding: 0;
          font-size: 16px;
          position: absolute;
          padding-left: 10px;
          // top: 5px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          height: 100%;
          // margin-bottom: 10px;
        }
      }
    }
        .box {
      width: 94%;
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-size: 18px;
      border: 1px solid #eee;
      color: #39c894;
      margin-left: 14px;
      margin-top: 15px;
      margin-bottom: 15px;
      .hyh {
        border-right: 1px solid #eee;
        .icon-change {
          font-size: 18px;
        }
      }
    }
  }
}
.swiper-name {
  width: 100%;
  display: flex;
  height: 60px;
  align-items: center;
  background-color: #ffffff;
  margin-top: 10px;
  padding-top: 10px;
  p {
    margin: 10px;
    padding: 0;
  }
  .pone {
    border-left: 3px solid #39cb94;
    font-size: 24px;
    padding-left: 10px;
  }
  .ptwo {
    color: #999999;
    font-size: 15px;
  }
}

</style>
